export function empty(value, placeholder = '') {
	// return this.empty(value) ? placeholder : value
	return uni.$uv.test.empty(value) || value == 'null' ? placeholder : value
}

/**
 * showToast 
 * @param {Object} msg msg
 */
export function showToast(msg) {
	uni.showToast({
		title: msg,
		icon: 'none',
		duration: 2000
	});
}

/**
 * 个位数number转中文
 * @param {Object} value number
 */
export function toChinese(value) {
	let cnum = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
	if (typeof(value) == 'number') {
		var a = value
	} else {
		var a = Number(value)
	}
	return cnum[a]
}

export default {
	empty,
	showToast,
	toChinese
}